<?php

class Admin_Form_RecursosManter extends Twitter_Bootstrap_Form_Horizontal
{

    public function init()
    {
        $this->setIsArray(true)
             ->setElementsBelongTo('');   
        
        $this->setAction('/admin/recursos/manter-recursos')
             ->setName('Form_ManterRecursos')
             ->setAttrib('id', 'form_manter-recursos')
             ->setMethod('post');
        
        $this->addElement('text', 'codigo', array('label'        => 'Código:',
                                                  'class'        => 'span2',
                                                  'filters'      => array('StringTrim', 'StripTags'),
                                                  'validators'   => array(array('StringLength', false, array(1,3)))
        
                          ));
        
        $this->addElement('text', 'descricao', array('label'        => 'Descrição:',
                                                     'class'        => 'span10',
                                                     'filters'      => array('StringTrim', 'StripTags'),
                                                     'validators'   => array(array('StringLength', false, array(2,30)))

                          ));
        
        
        $this->addElement('submit', 'btnCadastrar', array('label' => 'Cadastrar',
                                                          'class' => 'btn btn-primary'
                         ));
        

        $this->addElement('button', 'reset', array('label'         => 'Limpar',
                                                   'class'         => 'btn btn-danger',
                                                   'type'          => 'reset'
                          ));
        
        $this->addDisplayGroup(
            array('reset', 'btnCadastrar'),
            'btn',
            array(
                'disableLoadDefaultDecorators' => true,
                'decorators' => array('Actions')
            )
        );
        
    }
}